﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;


namespace NLServices
{
    [RunInstaller(true)]
    public partial class ProjectInstall : Installer
    {
        public ProjectInstall()
        {
            InitializeComponent();

            ServiceProcessInstaller processInstaller = new ServiceProcessInstaller();
            processInstaller.Account = ServiceAccount.LocalSystem;
            ServiceInstaller checkMailServiceInstaller = new ServiceInstaller();

            checkMailServiceInstaller.DisplayName = "NLTskServices";
            checkMailServiceInstaller.Description = "该服务为NewsLetter系统检测Email的服务.";
            checkMailServiceInstaller.StartType = ServiceStartMode.Automatic;
            checkMailServiceInstaller.ServiceName = "NLTskServices";

            ServiceInstaller sendMailServiceInstall = new ServiceInstaller();

            sendMailServiceInstall.DisplayName = "NLMailServices";
            sendMailServiceInstall.Description = "检测任务列表，并处理相应的任务的服务.";
            sendMailServiceInstall.StartType = ServiceStartMode.Automatic;
            sendMailServiceInstall.ServiceName = "NLMailServices";

            this.Installers.Add(processInstaller);
            this.Installers.Add(checkMailServiceInstaller);
            this.Installers.Add(sendMailServiceInstall);
            
        }
    }
}
